Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 20 Feb 2018, 16:03
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 84 of 84 [1259 Posts]   Goto page: Previous 1, 2, 3, ..., 82, 83, 84
Author Message
CatDude


Joined: 03 Jan 2007
Posts: 1566
Location: UK

PostPosted: Tue 23 Jan 2018, 08:08    Post subject:  

vovchik wrote:
Dear Lobster,

The linux version of growl (notification) program is here: https://github.com/mattn/growl-for-linux. There is source there, so I will download it and see whether/how it compiles on my PI3 and post some results here.

With kind regards,
vovchik


Hi

I think Lobster may be after the gtkdialog4 sources.
They are available here: https://github.com/01micko/gtkdialog
not sure if there are newer ones elsewhere though.

CatDude
.

_________________

Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15238
Location: Paradox Realm

PostPosted: Tue 23 Jan 2018, 10:21    Post subject:  

Thanks Vovchik and CatDude Very Happy

Will see how Vovchik gets on and then hopefully have a compiled deb?

I would compile it myself but am not great at compiling. Mind you there is a very nice set of demos on the raspberry pi website ... if it is just "make-c gtkdialog.h" I might be able to manage it . . .
https://projects.raspberrypi.org/en/projects/demo-programs

Meanwhile I am off to find The Blazing World ...
https://en.wikipedia.org/wiki/The_Blazing_World

_________________
YinYana AI Buddhism
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4922
Location: Ontario

PostPosted: Wed 24 Jan 2018, 21:07    Post subject:  

BarryK wrote:

There is a problem with window resizing, after doing a "show" then a "hide" again (with a "hide" button) -- the window stays bigger, with a gap in it.


I would try putting various widgets ---> text , hbox, hidden buttons
with space-expand="true" space-fill="true" directive to see if that
will change behaviour of gtkdialog resizing

<hbox space-expand="true" space-fill="true">


<text space-expand="true" space-fill="true">
<label>""</label>

_____________________________________________
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1447
Location: Ukraine

PostPosted: Thu 25 Jan 2018, 05:09    Post subject:  

Dear Lobster,

I managed to compile and install that growl in Tahr, but RP3 is proving more difficult. The problem is that the header files for openssl in the Raspbian repository (dev files) do not correspond with the biniaries installed. I am afraid I might bork my PI if I install the "recommended" fix to this problem and am still thinking of how to install the headers so that pkg-config knows about them and does not complain. I will get it to work eventually, I hope. I am not the first person to run into this problem....

With kind regards,
vovchik
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8427
Location: Perth, Western Australia

PostPosted: Fri 26 Jan 2018, 08:24    Post subject:  

I'm an occasional user of gtkdialog, have a burst of activity, then leave it for sometime. So I never really get in deep, but I am now trying to learn more.

And, I have just hit something that is contrary to my understanding up until now.

If you have some radiobutton, say:

Code:
<frame Radiobutton example>
   <radiobutton>
      <label>Radiobutton1</label>
      <action>echo Radiobutton1 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton2</label>
      <action>echo Radiobutton2 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton3</label>
      <action>echo Radiobutton3 is clicked.</action>
   </radiobutton>
</frame>


I always assumed that an action would execute if the radiobutton was clicked on. Yes, but the previously-selected radio button also fires it action.

So, initially Radiobutton1 is selected, then I click on Radiobutton2, and I get two echo messages:

Code:
Radiobutton1 is clicked.
Radiobutton2 is clicked.


I think that I have written some broken code in the past, because I didn't understand this.

To me, the default behaviour should be that only the clicked-on button fires its action. Anyway, how to fix this so that it does work as I want?

Well, this does fix it:

Code:
<frame Radiobutton example>
   <radiobutton>
      <label>Radiobutton1</label>
      <action signal="button-release-event">echo Radiobutton1 is clicked.</action>
      <action signal="button-release-event">echo DITTO Radiobutton1 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton2</label>
      <action signal="button-release-event">echo Radiobutton2 is clicked.</action>
      <action signal="button-release-event">echo DITTO Radiobutton2 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton3</label>
      <action signal="button-release-event">echo Radiobutton3 is clicked.</action>
      <action signal="button-release-event">echo DITTO Radiobutton3 is clicked.</action>
   </radiobutton>
</frame>


Now, if I click Radiobutton2, just get this:

Code:
Radiobutton2 is clicked.
DITTO Radiobutton2 is clicked.


But, is there any other more proper way to do it?

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8427
Location: Perth, Western Australia

PostPosted: Fri 26 Jan 2018, 08:42    Post subject:  

This also works;

Code:
<frame Radiobutton example>
   <radiobutton>
      <label>Radiobutton1</label>
      <variable>RAD1</variable>
      <action>if true echo Radiobutton1 is clicked.</action>
      <action>if true echo DITTO Radiobutton1 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton2</label>
      <action>if true echo Radiobutton2 is clicked.</action>
      <action>if true echo DITTO Radiobutton2 is clicked.</action>
      <action>if true hide:RAD1</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton3</label>
      <action>if true echo Radiobutton3 is clicked.</action>
      <action>if true echo DITTO Radiobutton3 is clicked.</action>
   </radiobutton>
</frame>


I stuck in this extra line:

Code:
<action>if true hide:RAD1</action>


The problem is though, if I have this form:

Code:
<action function="hide">RAD1</action>


...where do I put the "if true" logic?

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1449
Location: Japan

PostPosted: Fri 26 Jan 2018, 09:03    Post subject:  

BarryK wrote:
But, is there any other more proper way to do it?
What you need to know is that the default <action> of a radiobutton widget fires upon a "toggled" signal. So when you select Radiobutton2, Radiobutton2 is toggled from "false" state to "true" and at the same time Radiobutton1 is toggled from an initial "true" to "false", hence the <action>s of both radiobuttons are triggered. This would do what you intended:
Code:
<frame Radiobutton example>
    <radiobutton>
       <label>Radiobutton1</label>
       <action>if true echo Radiobutton1 is clicked.</action>
    </radiobutton>
    <radiobutton>
       <label>Radiobutton2</label>
       <action>if true echo Radiobutton2 is clicked.</action>
    </radiobutton>
    <radiobutton>
       <label>Radiobutton3</label>
       <action>if true echo Radiobutton3 is clicked.</action>
    </radiobutton>
 </frame>

Last edited by MochiMoppel on Fri 26 Jan 2018, 09:38; edited 1 time in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1449
Location: Japan

PostPosted: Fri 26 Jan 2018, 09:20    Post subject:  

Removed.

I thought that RAD1 is a separate widget that you want to hide. Now I realize that it's the first radiobutton. I'm not sure if I understand the purpose. You want to hide the first radiobutton by clicking the second?

Quote:
...where do I put the "if true" logic?
Nowhere.
It seems that with this syntax the function is executed only when the status is "true". Your code
Code:
<action function="hide">RAD1</action>
should work as intended.
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8427
Location: Perth, Western Australia

PostPosted: Fri 26 Jan 2018, 18:19    Post subject:  

MochiMoppel wrote:
Removed.

I thought that RAD1 is a separate widget that you want to hide. Now I realize that it's the first radiobutton. I'm not sure if I understand the purpose. You want to hide the first radiobutton by clicking the second?

Quote:
...where do I put the "if true" logic?
Nowhere.
It seems that with this syntax the function is executed only when the status is "true". Your code
Code:
<action function="hide">RAD1</action>
should work as intended.


Thanks for responding.

There was no purpose in hiding the first radiobutton. "RAD1" could be anything.

The problem remains. As you say,
Code:
<action function="hide">RAD1</action>
will fire on a toggle of state, but I only want it to fire when the state changes to true.

So, the question is, how do I put in the equivalent logic for "if true" for
Code:
<action function="hide">RAD1</action>


My previous example may have been unclear, so here it is again, to illustrate the problem:

Code:
<text><label>this is a label</label><variable>VAR1</variable></text>
<frame Radiobutton example>
   <radiobutton>
      <label>Radiobutton1</label>
      <variable>RAD1</variable>
      <action>if true echo Radiobutton1 is clicked.</action>
      <action>if true echo DITTO Radiobutton1 is clicked.</action>
      <action function="hide">VAR1</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton2</label>
      <variable>RAD2</variable>
      <action>if true echo Radiobutton2 is clicked.</action>
      <action>if true echo DITTO Radiobutton2 is clicked.</action>
   </radiobutton>
   <radiobutton>
      <label>Radiobutton3</label>
      <action>if true echo Radiobutton3 is clicked.</action>
      <action>if true echo DITTO Radiobutton3 is clicked.</action>
   </radiobutton>
</frame>


Initially, Radiobutton1 is selected. If I click on Radiobutton2, then the text label becomes hidden. NOT what I want!

EDIT:
In Thunar's documentation for the radiobutton, he has stated this:

Quote:
This widget's actions can be conditionally executed (based upon its active state) by prepending its contents with if true or if false although 0.8.3 introduced a dedicated condition attribute which may be more suitable.


However, I cannot find anywhere how it can be done with the condition attribute.

EDIT2
Got it! Had to search outside the Puppy Forum, found the answer here:

https://github.com/oshazard/gtkdialog/blob/master/examples/miscellaneous/break

This is the correct syntax:

Code:
      <action function="hide" condition="active_is_true(RAD1)">VAR1</action>


Yay, it works!

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8427
Location: Perth, Western Australia

PostPosted: Fri 26 Jan 2018, 19:37    Post subject:  

continuing from above, I ran into another problem...

In the app I am working on, I have a radiobutton action that already has a condition. Not the same as this, this is just for illustration:

Code:
   <action function="hide" condition="command_is_true(echo true)">VAR1</action>


So how to put in the test for the radiobutton being true? Any way to "and" the condition test?

Dunno, but I did this, it worked:

Code:
   <action signal="button-release-event" function="hide" condition="command_is_true(echo true)">VAR1</action>

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8427
Location: Perth, Western Australia

PostPosted: Fri 26 Jan 2018, 21:11    Post subject:  

Aaargh, here is something that caught me by surprise.

I naively assumed that multiple actions in a widget execute in their order of placement. Not always so!

Code:
   <radiobutton>
      <label>Radiobutton1</label>
      <variable>RAD1</variable>
      <action>if true echo True1 Radiobutton1</action>
      <action>if true echo True2 Radiobutton1</action>
      <action condition="active_is_true(RAD1)">echo True3 Radiobutton1</action>
      <action signal="button-release-event">echo True4 Radiobutton1</action>
      <action signal="button-release-event">echo True5 Radiobutton1</action>
   </radiobutton>


Output:

Code:
True4 Radiobutton1
True5 Radiobutton1
True1 Radiobutton1
True2 Radiobutton1
True3 Radiobutton1


I suppose that I can see the logic of it. A button release occurs, the actions are evaluated. Then, radiobutton changes state, the actions are evaluated again.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1449
Location: Japan

PostPosted: Fri 26 Jan 2018, 21:50    Post subject:  

BarryK wrote:
I was pretty sure that multiple actions in a widget execute in their order of placement
They do, but these have to be multiple actions for the same signal.
All actions for the signal "button-release-event" are performed consecutively, and all actions for the (default) signal "toggled" are also performed consecutively. Which signal's actions are executed first depends on the signal, but as I mentioned here the "custom actions" are executed first and the "default actions" (means actions for which you don't need to explicitly specify a signal because a default signal has been defined, here the "toggled") are executed last. Looking at your example you see that this rule applies.

As for your preceding posts: I'll let it settle as you eventually find the answers to your own questions. You'll see that the "if true" and "if false" constructs are more useful than you think and that button signals for radio buttons seldom need to be taken care of.

.

Last edited by MochiMoppel on Sat 27 Jan 2018, 08:54; edited 1 time in total
Back to top
View user's profile Send private message 
KuLuSz


Joined: 13 Dec 2017
Posts: 14
Location: HuNgArY

PostPosted: Sat 27 Jan 2018, 08:24    Post subject:  

"i have a dream" where gtkdialog used like a desktop environment ... any ideas or possiblity solutions ? I think the gtk desklets is good stuff for clone more big DEs,same like gtk3 in ubuntu main distro ... but i not want use gtk3 just 2. Smile i was look gtkbased DE thats the GPE environment , i was try install it , but need matchbox environment for managing windows , but when i try start its said not found display ... i try any display but cant start . Librarys are ok ...
_________________
-<(].K.u.L.u.S.z.[)>-

Last edited by KuLuSz on Sat 27 Jan 2018, 08:42; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15238
Location: Paradox Realm

PostPosted: Sat 27 Jan 2018, 08:35    Post subject:  

vovchik wrote:
Dear Lobster,

I managed to compile and install that growl in Tahr, but RP3 is proving more difficult. The problem is that the header files for openssl in the Raspbian repository (dev files) do not correspond with the biniaries installed. I am afraid I might bork my PI if I install the "recommended" fix to this problem and am still thinking of how to install the headers so that pkg-config knows about them and does not complain. I will get it to work eventually, I hope. I am not the first person to run into this problem....

With kind regards,
vovchik


Thanks Vovchik

I am happy to await your efforts. The RP3 is a great device. Really appreciate your efforts. Very Happy

Lobster

_________________
YinYana AI Buddhism
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 84 of 84 [1259 Posts]   Goto page: Previous 1, 2, 3, ..., 82, 83, 84
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1526s ][ Queries: 15 (0.0672s) ][ GZIP on ]