Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Toplevel and window manager
Hello all,

I'm currently diving in Tk programming aspect.
Until now I've mainly written pure Tcl (no graphical) application.
My Tk knowledge is rather limited to the simplest gui.
As far as I've seen on tutorial, wiki or here,
there is common advice to withdraw the . toplevel.
It seems to be related to the fact that when this window
is closed the no more Tk action can be performed.
Is that correct ?

Following this advice, I systematically create
another toplevel widget for the gui,
but there is slight difference with its window manager interaction:
It does not have the any miniaturize button.
I've been looking in the wm man page but did not found
anything clearly related to this aspect.

I'm also trying to desactivate the destroy button,
but did not find anything else than "wm protocol $window WM_DELETE_WINDOW.
It's a way to disable uncontrolled window close event,
but I would like to make it visible to the user.
Is there anyway to do this ?

------------------------------
David Bariod
For email replace spam by tel


Report this thread to moderator Post Follow-up to this message
Old Post
dbariod@norspam.com
04-22-05 01:58 PM


Re: Toplevel and window manager
dbariod@norspam.com wrote:
>
>     Hello all,
>
> I'm currently diving in Tk programming aspect.
> Until now I've mainly written pure Tcl (no graphical) application.
> My Tk knowledge is rather limited to the simplest gui.
> As far as I've seen on tutorial, wiki or here,
> there is common advice to withdraw the . toplevel.
> It seems to be related to the fact that when this window
> is closed the no more Tk action can be performed.
> Is that correct ?
>

More or less correct - it is an indication that
the program should close down, and normally it will
just do that.

> Following this advice, I systematically create
> another toplevel widget for the gui,
> but there is slight difference with its window manager interaction:
> It does not have the any miniaturize button.
> I've been looking in the wm man page but did not found
> anything clearly related to this aspect.
>

What platform are you using?

I have tried on Linux and Windows: I have no problem - the system close
button or equivalent is always present.

> I'm also trying to desactivate the destroy button,
> but did not find anything else than "wm protocol $window WM_DELETE_WINDOW.
> It's a way to disable uncontrolled window close event,
> but I would like to make it visible to the user.
> Is there anyway to do this ?
>

I am not sure what you mean by that. Can you explain what effect you
want
to achieve? How is the close event to be made visible?


Regards,

Arjen

Report this thread to moderator Post Follow-up to this message
Old Post
Arjen Markus
04-22-05 01:58 PM


Re: Toplevel and window manager

On Fri, 22 Apr 2005, Arjen Markus wrote:

> dbariod@norspam.com wrote: 
> 
>
> What platform are you using?
>
> I have tried on Linux and Windows: I have no problem - the system close
> button or equivalent is always present.
>

I'm running on Solaris with WindowMaker as window manager.
What do you call the system close button ?
I'm talking about the ``miniaturize'' button,
meaning the button when clicked put the window to the iconic
state. It is not there on window created with the command "toplevel the_topl
evel".
I will check how the window is displayed on cde and kde window manager,
it may be specific to Window Maker.

> 
>
> I am not sure what you mean by that. Can you explain what effect you
> want
> to achieve? How is the close event to be made visible?
>

For example, I want t not have the button to not appear (on windows)
or, on WindowMaker, to have the special layout  which means
"You can not click on this button".

------------------------------
David Bariod
For email replace spam by tel

Report this thread to moderator Post Follow-up to this message
Old Post
dbariod@norspam.com
04-22-05 09:01 PM


Re: Toplevel and window manager
dbariod@norspam.com wrote:
>
> On Fri, 22 Apr 2005, Arjen Markus wrote:
> 
>
> I'm running on Solaris with WindowMaker as window manager.
> What do you call the system close button ?
> I'm talking about the ``miniaturize'' button,
> meaning the button when clicked put the window to the iconic
> state. It is not there on window created with the command "toplevel the_to
plevel".
> I will check how the window is displayed on cde and kde window manager,
> it may be specific to Window Maker.
>

Window managers sometimes have very particular ideas on what they should
do.
I am not familiar with this one and I have a hunch that it is indeed
WM-specific.

(I misread the "miniaturise" as "close" - this is moslty called the
iconify
button)
 
>
> For example, I want t not have the button to not appear (on windows)
> or, on WindowMaker, to have the special layout  which means
> "You can not click on this button".
>

Okay, that is clearer. My answer: I do not know how you can achieve
that.

Regards,

Arjen

Report this thread to moderator Post Follow-up to this message
Old Post
Arjen Markus
04-22-05 09:01 PM


Re: Toplevel and window manager

On Fri, 22 Apr 2005, Arjen Markus wrote:

> dbariod@norspam.com wrote: 
>
> Window managers sometimes have very particular ideas on what they should
> do.
> I am not familiar with this one and I have a hunch that it is indeed
> WM-specific.
>

I confirm this is clearly a WindowMaker bug.
The iconify button __sometime__ does not appear,
the occurence of the problem is also seems related with the name
of the toplevel.
It works perfectly on cde or kde.

> 
>
> Okay, that is clearer. My answer: I do not know how you can achieve
> that.

I will stay with the wm protocol solution.

------------------------------
David Bariod
For email replace spam by tel


Report this thread to moderator Post Follow-up to this message
Old Post
dbariod@norspam.com
04-22-05 09:01 PM


Re: Toplevel and window manager
dbariod@norspam.com writes:

> I confirm this is clearly a WindowMaker bug.
> The iconify button __sometime__ does not appear,
> the occurence of the problem is also seems related with the name
> of the toplevel.

Could it be that the problematic names are known to the WM as
some other applications, with registerd preferences for no
minimize button?

Maybe it allows minimize control over only the first wndow with
the same title?

Sometimes the title is used by a WM or "desktop environment" to
assign a mini-icon and to group windows on a task-bar, so this
case may be similar.

--
Donald Arseneau                          asnd@triumf.ca

Report this thread to moderator Post Follow-up to this message
Old Post
Donald Arseneau
04-23-05 01:58 AM


Re: Toplevel and window manager

On Sat, 22 Apr 2005, Donald Arseneau wrote:

> dbariod@norspam.com writes:
> 
>
> Could it be that the problematic names are known to the WM as
> some other applications, with registerd preferences for no
> minimize button?
>

It might be.
I'm writing a package which dynamically generates widget
names in order to not have anymore any widget path name
hardcoded within the application.
I merely use a base string pattern concatened with a numerical id.

>
> Maybe it allows minimize control over only the first wndow with
> the same title?
>

Don't know, but it's not the case I'm in, because each window has
a different title.

> Sometimes the title is used by a WM or "desktop environment" to
> assign a mini-icon and to group windows on a task-bar, so this
> case may be similar.
>

Long time I did not write any plain/good/raw X code.
I almost forget everything about these X resources.
For now I've just changed the string pattern used for widget
name generation.
It seems to work, that's ok for now.
I will check what the problem was later.
Thanks for help and advices.

------------------------------
David Bariod
For email replace spam by tel


Report this thread to moderator Post Follow-up to this message
Old Post
dbariod@norspam.com
04-25-05 01:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:25 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.